package com.lk.springboot.mapper;

import com.lk.springboot.bean.Users;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UsersMapper {
    @Select("select * from users ")
    List<Users> findAll();

    @Select("select * from users where id=#{id}")
    public Users findById(int id);

    @Insert(" insert into users (name,sex,age) values(#{name},#{sex},#{age}) ")
    public int save(Users users);

    @Update("update users set name=#{name},sex=#{sex},age=#{age} where id=#{id} ")
    public int update(Users users);

    @Delete(" delete from users where id= #{id} ")
    public void delete(int id);
}
